package com.itheima.idea;

public class DemoString {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 50000; i++) {
            sb.append(i);
        }
        long end = System.currentTimeMillis();
        System.out.println(end - start);




        long start2 = System.currentTimeMillis();
        String sb2 = new String(" ");
        for(int i = 0; i < 50000; i++) {
                sb2 += i;
        }
        long end2 = System.currentTimeMillis();
        System.out.println(end2 - start2);
    }
    }




